package com.nc.mem.tests.cycle;

public final class CyclicFinal {

	String id;

	CyclicFinal prev;

	CyclicFinal next;

	@Override
	public boolean equals(final Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		final CyclicFinal other = (CyclicFinal) obj;
		if (id == null) {
			if (other.id != null) {
				return false;
			}
		} else if (!id.equals(other.id)) {
			return false;
		}

		if (this.prev == this && other.prev != other) {
			return false;
		}

		if (this.next == this && other.next != other) {
			return false;
		}

		return true;
	}

}
